#ifndef __ITERLIST_H__
#define __ITERLIST_H__

/*ListIter is struct that provides the user option to do manipulations
  on the object in the list*/
typedef struct ListIter_t* ListIter;

typedef struct List_t List;

/*Alloc memory to the struct List and it's data members if alloc
  failes 0 will be returned*/
List*      ListNew    (void);

/*Frees alloc mem for the struct list and it's contents*/
void       ListDel    (List*);

/*Function returns iterator to the first obj in the list
  if the list empty end iterator will be returned*/
ListIter   ListBegin  (List*);

/*Function returnes iterator to the end of the list, end
  is out of bounds of the list it's not an object in the list*/
ListIter   ListEnd    (List*);

/*Function forwards the iterator to the next object in the list*/
ListIter   ListNext   (ListIter);

/*Function backwards the iterator to the preveous object in the list*/
ListIter   ListPrev   (ListIter);

/*Function returnes data of the wanted iterator*/
void*      ListGetData(ListIter);

/*Function inserts object to the list before the given iterator,
  In the case insertion is failed end iterator will be returned*/
ListIter   ListInsert (List*,ListIter,void* _data);

/*Function erases the object of the given iterator,
  next object list iterator is returned*/
ListIter   ListErase (ListIter);

/*Function returnes 1 if there are no objects in the list
  and 0 if there are objects*/
int        ListIsEmpty(List*);

/*Function returnes number of objects in the list,
  function operates in O(n)*/
size_t ListCount(List* _list);

#endif /* __ITERLIST_H__*/
